package com.imy.common.base;

import android.graphics.drawable.ColorDrawable;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.PopupWindow;

import androidx.appcompat.app.AppCompatActivity;

public abstract class BasePopWindows {
    protected AppCompatActivity activity;
    private PopupWindow popupWindow;

    public BasePopWindows(AppCompatActivity appCompatActivity) {
        this.activity = appCompatActivity;
        init(activity);
    }

    private void init(AppCompatActivity activity) {
        View inflate = View.inflate(activity, getLayoutID(),null);
        popupWindow = new PopupWindow(inflate, WindowManager.LayoutParams.WRAP_CONTENT,WindowManager.LayoutParams.WRAP_CONTENT);
        popupWindow.setOutsideTouchable(true);
        popupWindow.setBackgroundDrawable(new ColorDrawable());
    }
    protected void  show(){
//        popupWindow.showAtLocation();
    }
    protected abstract int getLayoutID();

}
